import Vue from 'vue'
import VueRouter from 'vue-router'
import dbBooks from '../views/Details.vue'
import index from '../views/index.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import Yue from '../views/Yue.vue'
import Publish from '../views/Publish.vue'
import Original from '../views/Original.vue'
import Publish_details from '../views/Publish_details.vue'
import Twy from '../views/twy.vue'
import Testing from '../views/testing.vue'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // },
  {
    path: "/",
    name: "index",
    meta: {},
    component: index
  },
  {
    path: '/detail',
    name: 'detail',
    meta: {},
    component: dbBooks
  },
  {
    path: '/original',
    name: 'Original',
    component: Original
  },
  {
    path: '/publish',
    name: 'publish',
    component: Publish
  },
  {
    path: '/publish_details',
    name: 'publish_details',
    component: Publish_details
  },
  {
    path: '/channel',
    name: 'Channel',
    component: () => import( /* webpackChunkName: "Channel" */ '../views/Channel')
  },
  // 这里是懒加载

  {
    path: '/readmore',
    name: 'ReadMore',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import( /* webpackChunkName: "ReadMore" */ '../views/ReadMore')
  },
  {
    path: '/yue',
    name: 'Yue',
    component: Yue
  },
  {
    path: '/reg',
    name: 'Register',
    component: Register
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/twy',
    name:'twy',
    component:Twy
  },
  {
    path: '/testing',
    name:'testing',
    component:Testing
  },
  {
    path:'/charts',
    name:'charts',
    component:()=>import(/* webpackChunkName: "about" */ '../views/Charts'),
    children:[
      {
        path:'/',
        component:()=>import(/* webpackChunkName: "about" */ '../components/rank/myC')
      },
      {
      path:'featured',
      component:()=>import(/* webpackChunkName: "about" */ '../components/rank/Featured')
      },
      {
       path:'my-stery',
       component:()=>import(/* webpackChunkName: "about" */ '../components/rank/myStery') 
      },
      {
        path:'womens',
        component:()=>import(/* webpackChunkName: "about" */ '../components/rank/Womens')
      },
      {
        path:'fantasy',
        component:()=>import(/* webpackChunkName: "about" */ '../components/rank/Fantasy')
      },
      {
        path:'literary',
        component:()=>import(/* webpackChunkName: "about" */ '../components/rank/Literary')
      },
      {
        path:'historical',
        component:()=>import(/* webpackChunkName: "historical" */ '../components/rank/Historical')
      },
      {
        path:'ebook',
        component:()=>import(/* webpackChunkName: "about" */ '../components/rank/Ebook')
      },
      ]
  }

]

const router = new VueRouter({
  routes
})

export default router